package newTest.test14;

import javax.sql.DataSource;

import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;

public class DaoFactory {
@Bean
	public DataSource dataSource(){

		SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
	
		dataSource.setDriverClass(oracle.jdbc.driver.OracleDriver.class);
		
		dataSource.setUrl("jdbc:oracle:thin:@127.0.0.1:1521:xe");
		dataSource.setUsername("ksuniry");
		dataSource.setPassword("73031523");
		
	 return dataSource;
	}
@Bean
	public UserDao userDao(){
		UserDao userDao = new UserDao();
		userDao.setDataSource(dataSource());
		return userDao;
	}
}

